/*
 * @Author: lee
 * @Date: 2021-05-12 19:36:08
 * @LastEditTime: 2021-05-18 11:33:08
 * @LastEditors: lee
 * @Description:
 */

function resetRem(doc, win, undefined) {
    var docEl = doc.documentElement,
        resizeEvt = 'orientationchange' in win ? 'orientationchange' : 'resize',
        recalc = function () {
            var clientWidth = docEl.clientWidth;
            if (clientWidth === undefined) return;
            docEl.style.fontSize = Math.floor(100 * (clientWidth / 375)) + 'px';
        };
    if (doc.addEventListener === undefined) return;
    win.addEventListener(resizeEvt, recalc, false);
    doc.addEventListener('DOMContentLoaded', recalc, false)
}

function setPlatform() {
    var ua = navigator.userAgent.toLowerCase();
    var isIos = /(ios|ipad|iphone)/.test(ua) || ua.indexOf('macintosh') > -1 && 'ontouchend' in document;
    var isAndroid = /android/.test(ua);
    var res = isIos ? 'ios' : 'android';
    window.isIos = isIos;
    window.isAndroid = isAndroid;
    platform = res;
    return res;
}

async function aaa() {

    let ios = await fetch('https://wgapi.huoniuzhibo.com/app/web/configsetup/iosTiYu').then(response => response.json())

    let android = await fetch('https://wgapi.huoniuzhibo.com/app/web/configsetup/androidTiYu').then(response => response.json())
    // downloadUrl = {
    //     ios: ios.downloadUrl,
    //     android: android.downloadUrl
    // }[platform];
    if (platform === 'ios') {
        downloadUrl = ios.data.downloadUrl
    } else {
        downloadUrl = android.data.downloadUrl
    }
}
var platform = ''; // ios 或 android 平台
;
(function (doc, win, undefined) {


    resetRem(doc, win, undefined);

    // setPlatform();
    // aaa()
})(document, window);